<!DOCTYPE HTML>
<html lang="zh-tw" >
    <!-- Start book python高级 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>HTTP请求报文格式 | python高级</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../day09/05.获取请求报文原数据.html" />
    
    
    <link rel="prev" href="../day09/03.谷歌浏览器开发者工具查看http协议的通信过程.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="9.4"
        data-chapter-title="HTTP请求报文格式"
        data-filepath="day09/04.http请求报文.md"
        data-basepath=".."
        data-revision="Sat Sep 08 2018 13:52:27 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Python高级
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="day01/index.html">
            
                
                    <a href="../day01/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Linux系统基础
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="day01/01.操作系统.html">
            
                
                    <a href="../day01/01.操作系统.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        操作系统(科普章节)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="day01/02.操作系统发展史.html">
            
                
                    <a href="../day01/02.操作系统发展史.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        操作系统发展史(科普章节)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="day01/03.Ubuntu图形界面入门.html">
            
                
                    <a href="../day01/03.Ubuntu图形界面入门.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        Ubuntu图形界面入门
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="day01/04.文件目录.html">
            
                
                    <a href="../day01/04.文件目录.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        文件目录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="day01/05.常用Linux命令的基本使用.html">
            
                
                    <a href="../day01/05.常用Linux命令的基本使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        常用Linux命令的基本使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="day01/06.Linux终端命令格式.html">
            
                
                    <a href="../day01/06.Linux终端命令格式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        Linux终端命令格式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="day01/07.常用Linux命令选项的使用.html">
            
                
                    <a href="../day01/07.常用Linux命令选项的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        常用Linux命令选项的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="day02/index.html">
            
                
                    <a href="../day02/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        Linux系统命令
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="day02/01.高级Linux命令及命令选项.html">
            
                
                    <a href="../day02/01.高级Linux命令及命令选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        高级Linux命令及命令选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="day02/02.远程登录和远程拷贝.html">
            
                
                    <a href="../day02/02.远程登录和远程拷贝.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        远程登录和远程拷贝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="day02/03.软件安装与卸载.html">
            
                
                    <a href="../day02/03.软件安装与卸载.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        软件安装与卸载
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="day02/04.编辑器vim.html">
            
                
                    <a href="../day02/04.编辑器vim.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        编辑器vim
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="day02/05.命令总结.html">
            
                
                    <a href="../day02/05.命令总结.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        命令总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="day03/index.html">
            
                
                    <a href="../day03/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        网络-UDP
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="day03/01.网络概述.html">
            
                
                    <a href="../day03/01.网络概述.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        网络概述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="day03/02.ip地址.html">
            
                
                    <a href="../day03/02.ip地址.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        IP地址
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="day03/03.Linux命令-ping和ifconfig.html">
            
                
                    <a href="../day03/03.Linux命令-ping和ifconfig.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Linux命令-ping和ifconfig
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="day03/04.端口.html">
            
                
                    <a href="../day03/04.端口.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        端口
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="day03/05.网络传输方式udp.html">
            
                
                    <a href="../day03/05.网络传输方式udp.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        网络传输方式-UDP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="day03/06.socket介绍.html">
            
                
                    <a href="../day03/06.socket介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        socket介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="day03/07.udp网络程序-发送、接收数据.html">
            
                
                    <a href="../day03/07.udp网络程序-发送、接收数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        udp网络程序-发送、接收数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="day03/08.数据编码和解码.html">
            
                
                    <a href="../day03/08.数据编码和解码.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        数据编码和解码
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="day03/09.udp绑定端口号.html">
            
                
                    <a href="../day03/09.udp绑定端口号.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        udp绑定端口号
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="day03/11.案例-UDP发送广播消息.html">
            
                
                    <a href="../day03/11.案例-UDP发送广播消息.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        案例-udp发送广播消息
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="day03/12.udp聊天器.html">
            
                
                    <a href="../day03/12.udp聊天器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        案例-udp聊天器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="day04/index.html">
            
                
                    <a href="../day04/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        网络-TCP
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="day04/01.tcp简介.html">
            
                
                    <a href="../day04/01.tcp简介.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        网络传输方式-TCP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="day04/02.tcp网络程序-客户端.html">
            
                
                    <a href="../day04/02.tcp网络程序-客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        TCP网络程序-客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="day04/03.tcp网络程序-服务端.html">
            
                
                    <a href="../day04/03.tcp网络程序-服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        TCP网络程序-服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="day04/04.tcp注意点.html">
            
                
                    <a href="../day04/04.tcp注意点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        TCP注意点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="day04/05.案例-文件下载器.html">
            
                
                    <a href="../day04/05.案例-文件下载器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        案例-文件下载器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="day04/06.tcp的3次握手.html">
            
                
                    <a href="../day04/06.tcp的3次握手.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        tcp的3次握手
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="day04/07.tcp的4次挥手.html">
            
                
                    <a href="../day04/07.tcp的4次挥手.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        tcp的4次挥手
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="day04/08.wireshark的使用.html">
            
                
                    <a href="../day04/08.wireshark的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        wireshark的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="day05/index.html">
            
                
                    <a href="../day05/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        多任务-线程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="day05/01.多任务的介绍.html">
            
                
                    <a href="../day05/01.多任务的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        多任务的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="day05/02.线程.html">
            
                
                    <a href="../day05/02.线程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        线程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="day05/03.线程注意点.html">
            
                
                    <a href="../day05/03.线程注意点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        线程的注意点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="day05/04.自定义线程.html">
            
                
                    <a href="../day05/04.自定义线程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        自定义线程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="day05/05.多线程-共享全局变量.html">
            
                
                    <a href="../day05/05.多线程-共享全局变量.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        多线程-共享全局变量
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="day05/06.多线程-共享全局变量问题.html">
            
                
                    <a href="../day05/06.多线程-共享全局变量问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        多线程-共享全局变量问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="day05/07.互斥锁.html">
            
                
                    <a href="../day05/07.互斥锁.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        互斥锁
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="day05/08.死锁.html">
            
                
                    <a href="../day05/08.死锁.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        死锁
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="day05/09.案例-多任务udp聊天器.html">
            
                
                    <a href="../day05/09.案例-多任务udp聊天器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        案例-多任务版udp聊天器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="day05/10.案例-多任务版TCP服务端.html">
            
                
                    <a href="../day05/10.案例-多任务版TCP服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        案例-多任务版TCP服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.11" data-path="day05/11.案例-多任务版文件下载.html">
            
                
                    <a href="../day05/11.案例-多任务版文件下载.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.11.</b>
                        
                        案例-多任务版文件下载
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="day06/index.html">
            
                
                    <a href="../day06/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        多任务-进程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="day06/01.进程介绍.html">
            
                
                    <a href="../day06/01.进程介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        进程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="day06/02.进程的使用.html">
            
                
                    <a href="../day06/02.进程的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        进程的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="day06/03.进程注意点.html">
            
                
                    <a href="../day06/03.进程注意点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        进程注意点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="day06/04.进程间通信-Queue.html">
            
                
                    <a href="../day06/04.进程间通信-Queue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        进程间通信-Queue
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="day06/05.进程池.html">
            
                
                    <a href="../day06/05.进程池.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        进程的创建-进程池
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="day06/06.进程、线程对比.html">
            
                
                    <a href="../day06/06.进程、线程对比.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        进程和线程的对比
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="day06/07.案例-文件夹拷贝器-多任务版.html">
            
                
                    <a href="../day06/07.案例-文件夹拷贝器-多任务版.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        案例-多任务版文件夹拷贝器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="day07/index.html">
            
                
                    <a href="../day07/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        多任务-协程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="day07/01.迭代.html">
            
                
                    <a href="../day07/01.迭代.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        迭代
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="day07/02.迭代器.html">
            
                
                    <a href="../day07/02.迭代器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        迭代器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="day07/03.生成器.html">
            
                
                    <a href="../day07/03.生成器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        生成器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="day07/04.协程-yield.html">
            
                
                    <a href="../day07/04.协程-yield.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        协程-yield
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="day07/05.协程-greenlet.html">
            
                
                    <a href="../day07/05.协程-greenlet.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        协程-greenlet
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="day07/06.协程-gevent.html">
            
                
                    <a href="../day07/06.协程-gevent.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        协程-gevent
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7" data-path="day07/07.进程、线程、协程对比.html">
            
                
                    <a href="../day07/07.进程、线程、协程对比.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.</b>
                        
                        进程、线程、协程区别
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.8" data-path="day07/08.案例-gevent多任务图片下载.html">
            
                
                    <a href="../day07/08.案例-gevent多任务图片下载.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.8.</b>
                        
                        案例-gevent多任务图片下载
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="day08/index.html">
            
                
                    <a href="../day08/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        正则表达式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="day08/01.正则表达式的介绍.html">
            
                
                    <a href="../day08/01.正则表达式的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        正则表达式的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="day08/02.re模块介绍.html">
            
                
                    <a href="../day08/02.re模块介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        re模块介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="day08/03.匹配单个字符.html">
            
                
                    <a href="../day08/03.匹配单个字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        匹配单个字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="day08/04.匹配多个字符.html">
            
                
                    <a href="../day08/04.匹配多个字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.4.</b>
                        
                        匹配多个字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.5" data-path="day08/05.匹配开头和结尾.html">
            
                
                    <a href="../day08/05.匹配开头和结尾.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.5.</b>
                        
                        匹配开头和结尾
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.6" data-path="day08/06.匹配分组.html">
            
                
                    <a href="../day08/06.匹配分组.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.6.</b>
                        
                        匹配分组
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.7" data-path="day08/07.re模块的高级用法.html">
            
                
                    <a href="../day08/07.re模块的高级用法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.7.</b>
                        
                        re模块的高级用法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.8" data-path="day08/08.贪婪和非贪婪.html">
            
                
                    <a href="../day08/08.贪婪和非贪婪.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.8.</b>
                        
                        贪婪和非贪婪
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.9" data-path="day08/09.r的作用.html">
            
                
                    <a href="../day08/09.r的作用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.9.</b>
                        
                        r的作用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="day09/index.html">
            
                
                    <a href="../day09/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        HTTP协议
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="day09/01.浏览器访问服务器的过程.html">
            
                
                    <a href="../day09/01.浏览器访问服务器的过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        浏览器访问服务器的过程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="day09/02.http协议.html">
            
                
                    <a href="../day09/02.http协议.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.2.</b>
                        
                        HTTP协议介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="day09/03.谷歌浏览器开发者工具查看http协议的通信过程.html">
            
                
                    <a href="../day09/03.谷歌浏览器开发者工具查看http协议的通信过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.3.</b>
                        
                        开发工具查看http协议通信过程
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="9.4" data-path="day09/04.http请求报文.html">
            
                
                    <a href="../day09/04.http请求报文.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.4.</b>
                        
                        HTTP请求报文格式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.5" data-path="day09/05.获取请求报文原数据.html">
            
                
                    <a href="../day09/05.获取请求报文原数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.5.</b>
                        
                        获取请求报文原数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.6" data-path="day09/06.http响应报文.html">
            
                
                    <a href="../day09/06.http响应报文.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.6.</b>
                        
                        HTTP响应报文格式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.7" data-path="day09/07.tcp长连接和短连接.html">
            
                
                    <a href="../day09/07.tcp长连接和短连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.7.</b>
                        
                        长连接和短连接
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.8" data-path="day09/08.案例-模拟浏览器的实现.html">
            
                
                    <a href="../day09/08.案例-模拟浏览器的实现.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.8.</b>
                        
                        案例-模拟浏览器的实现
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="10" data-path="day10/index.html">
            
                
                    <a href="../day10/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        Web静态服务器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="10.1" data-path="day10/01.返回固定数据.html">
            
                
                    <a href="../day10/01.返回固定数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.1.</b>
                        
                        返回固定数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.2" data-path="day10/02.返回固定页面数据.html">
            
                
                    <a href="../day10/02.返回固定页面数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.2.</b>
                        
                        返回固定页面数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.3" data-path="day10/03.返回指定页面数据.html">
            
                
                    <a href="../day10/03.返回指定页面数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.3.</b>
                        
                        返回指定页面数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.4" data-path="day10/04.返回404页面数据.html">
            
                
                    <a href="../day10/04.返回404页面数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.4.</b>
                        
                        返回404页面数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.5" data-path="day10/05.多任务web服务器.html">
            
                
                    <a href="../day10/05.多任务web服务器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.5.</b>
                        
                        多任务web服务器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.6" data-path="day10/06.web服务器面向对象开发.html">
            
                
                    <a href="../day10/06.web服务器面向对象开发.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.6.</b>
                        
                        web服务器面向对象开发
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.7" data-path="day10/07.给web服务器添加命令行参数.html">
            
                
                    <a href="../day10/07.给web服务器添加命令行参数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.7.</b>
                        
                        给web服务器添加命令行参数
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >python高级</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="http-&#x8BF7;&#x6C42;&#x62A5;&#x6587;&#x534F;&#x8BAE;&#x5206;&#x6790;">HTTP &#x8BF7;&#x6C42;&#x62A5;&#x6587;&#x534F;&#x8BAE;&#x5206;&#x6790;</h1>
<h2 id="&#x76EE;&#x6807;">&#x76EE;&#x6807;</h2>
<ul>
<li>&#x77E5;&#x9053;HTTP&#x534F;&#x8BAE;&#x8BF7;&#x6C42;&#x62A5;&#x6587;&#x7684;&#x683C;&#x5F0F;</li>
</ul>
<p>&#x9996;&#x5148;&#xFF0C;&#x6211;&#x4EEC;&#x901A;&#x8FC7;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x67E5;&#x770B;&#x4E00;&#x4E0B;&#x8BF7;&#x6C42;&#x62A5;&#x6587;&#x7684;&#x683C;&#x5F0F;.</p>
<p><img src="imgs/&#x8BF7;&#x6C42;-1.png" alt=""></p>
<p>Request Headers &#x4E2D;&#x5C31;&#x662F;&#x8BF7;&#x6C42;&#x7684;&#x62A5;&#x6587;&#x6570;&#x636E;&#x5185;&#x5BB9;.  &#x4E0B;&#x9762;&#x5C31;&#x662F;&#x6211;&#x4EEC;&#x8981;&#x8BF7;&#x6C42;&#x7684;&#x62A5;&#x6587;&#x793A;&#x4F8B;&#x6570;&#x636E;:</p>
<pre><code class="lang-python">GET / HTTP/<span class="hljs-number">1.1</span>
Host: localhost:<span class="hljs-number">10000</span>
Connection: keep-alive
User-Agent: Mozilla/<span class="hljs-number">5.0</span> (Macintosh; Intel Mac OS X <span class="hljs-number">10</span>_13_3) AppleWebKit/<span class="hljs-number">537.36</span> (KHTML, like Gecko) Chrome/<span class="hljs-number">64.0</span><span class="hljs-number">.3282</span><span class="hljs-number">.186</span> Safari/<span class="hljs-number">537.36</span>
Accept: text/html,application/xhtml+xml,application/xml;q=<span class="hljs-number">0.9</span>,image/webp,image/apng,*/*;q=<span class="hljs-number">0.8</span>
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=<span class="hljs-number">0.9</span>,en;q=<span class="hljs-number">0.8</span>,zh-TW;q=<span class="hljs-number">0.7</span>
</code></pre>
<ol>
<li><p>GET / HTTP/1.1 &#x53EB;&#x505A;&#x8BF7;&#x6C42;&#x884C;. &#x91CC;&#x9762;&#x5305;&#x542B;3&#x4E2A;&#x4FE1;&#x606F;, &#x4EE5;&#x7A7A;&#x683C;&#x9694;&#x5F00;, </p>
<ul>
<li><p>&#x7B2C;&#x4E00;&#x4E2A;&#x53EB;&#x505A;&#x8BF7;&#x6C42;&#x65B9;&#x6CD5;, &#x9664;&#x4E86; GET &#x65B9;&#x6CD5;&#x4E4B;&#x5916;, &#x8FD8;&#x6709; POST &#x65B9;&#x6CD5;, &#x9664;&#x6B64;&#x4E4B;&#x5916;&#x8FD8;&#x6709;&#x5176;&#x4ED6;&#x65B9;&#x6CD5;, &#x8FD9;&#x4E24;&#x79CD;&#x6700;&#x5E38;&#x7528;. GET &#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x4ECE;&#x670D;&#x52A1;&#x5668;&#x83B7;&#x5F97;&#x6570;&#x636E;, POST &#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x4ECE;&#x6D4F;&#x89C8;&#x5668;&#x63D0;&#x4EA4;&#x6570;&#x636E;&#x5230;&#x670D;&#x52A1;&#x5668;. &#x6BD4;&#x5982;&#x50CF;&#x767E;&#x5EA6;&#x9996;&#x9875;&#x63D0;&#x4F9B;&#x7684;&#x4E0A;&#x4F20;&#x56FE;&#x7247;&#x7684;&#x529F;&#x80FD;, &#x5C31;&#x662F;&#x7528;POST&#x65B9;&#x5F0F;.</p>
</li>
<li><p>&#x7B2C;&#x4E8C;&#x4E2A;&#x8868;&#x793A;&#x8BF7;&#x6C42;&#x7684;&#x8D44;&#x6E90;&#x8DEF;&#x5F84;.  &#x5F53;&#x8BF7;&#x6C42;&#x7684;URL&#x662F; <a href="https://www.baidu.com/" target="_blank">https://www.baidu.com/</a>, &#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x4F1A;&#x53D1;&#x73B0; &#x8DEF;&#x5F84;&#x4F1A;&#x663E;&#x793A; &apos;/&apos;, &#x90A3;&#x4E48;&#x5982;&#x679C;&#x8BF7;&#x6C42;&#x7684;URL&#x662F; <a href="https://www.baidu.com/index.html" target="_blank">https://www.baidu.com/index.html</a>, &#x6211;&#x4EEC;&#x4F1A;&#x53D1;&#x73B0;&#x8DEF;&#x5F84;&#x663E;&#x793A;&#x662F; &apos;/index.html&apos;.    </p>
</li>
<li>&#x7B2C;&#x4E09;&#x4E2A;&#x8868;&#x793A; HTTP &#x534F;&#x8BAE;&#x7684;&#x7248;&#x672C;, &#x90A3;&#x4E48;&#x65E2;&#x7136;&#x6709; 1.1&#x7248;&#x672C;&#xFF0C; &#x524D;&#x7F6E;&#x7248;&#x672C;&#x80AF;&#x5B9A;&#x662F;1.0&#x4E86;&#xFF0C;&#x90A3;&#x4E48;&#x4E24;&#x4E2A;&#x7248;&#x672C;&#x6709;&#x4EC0;&#x4E48;&#x533A;&#x522B;&#x5462;? 1.1&#x7248;&#x672C;&#x6BD4;1.0&#x7684;&#x7248;&#x672C;&#x4E3B;&#x8981;&#x591A;&#x4E2A;&#x4E00;&#x4E9B;&#x8BF7;&#x6C42;&#x65B9;&#x6CD5;&#x7B49;&#x6269;&#x5145;&#x534F;&#x8BAE;&#x7684;&#x5185;&#x5BB9;.</li>
</ul>
</li>
</ol>
<p><strong>&#x95EE;&#x9898;: &#x5982;&#x679C;&#x7528;&#x6237;&#x8BF7;&#x6C42;&#x8DEF;&#x5F84;&#x662F; <a href="https://www.baidu.com/abc.png" target="_blank">https://www.baidu.com/abc.png</a>, &#x90A3;&#x4E48;&#x8D44;&#x6E90;&#x8DEF;&#x5F84;&#x4F1A;&#x663E;&#x793A;&#x4E3A;&#x4EC0;&#x4E48;&#x5462;?</strong></p>
<ol>
<li><p>&#x8BF7;&#x6C42;&#x5934;. &#x9664;&#x4E86;&#x7B2C;&#x4E00;&#x884C;&#x4E4B;&#x5916;, &#x5269;&#x4E0B;&#x7684;&#x6240;&#x6709;&#x6570;&#x636E;&#x7684;&#x683C;&#x5F0F;&#x90FD;&#x662F;&#x7C7B;&#x4F3C;&#x7684;.</p>
<ul>
<li><p>Host &#x8868;&#x793A;&#x6D4F;&#x89C8;&#x5668;&#x8981;&#x8BF7;&#x6C42;&#x7684;&#x4E3B;&#x673A;&#x5730;&#x5740;. &#x8FD9;&#x662F;&#x6211;&#x4EEC;&#x67E5;&#x770B;&#x4E0B; baidu.com  itcastcpp.cn&#xFF0C; &#x8BF7;&#x6C42;&#x4E0D;&#x540C;&#x7684;&#x7F51;&#x7AD9;, &#x4F1A;&#x6709;&#x4E0D;&#x540C;&#x7684;&#x4E3B;&#x673A;&#x5730;&#x5740;.</p>
</li>
<li><p>Connection &#x8868;&#x793A;&#x6D4F;&#x89C8;&#x5668;&#x548C;&#x670D;&#x52A1;&#x5668;&#x4E4B;&#x95F4;&#x7684;&#x8FDE;&#x63A5;&#x65B9;&#x5F0F;, &#x6D4F;&#x89C8;&#x5668;&#x548C;&#x670D;&#x52A1;&#x5668;&#x8FDE;&#x63A5;&#x662F;&#x957F;&#x8FDE;&#x63A5;&#x8FD8;&#x662F;&#x77ED;&#x8FDE;&#x63A5;, &#x7A0D;&#x540E;&#x4F1A;&#x8BB2;&#x89E3;.</p>
</li>
<li><p>User-Agent &#x7528;&#x6237;&#x4EE3;&#x7406;, &#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x8C37;&#x6B4C;&#x6D4F;&#x89C8;&#x5668;&#x548C;&#x706B;&#x72D0;&#x6D4F;&#x89C8;&#x5668;&#x5206;&#x522B;&#x8BF7;&#x6C42;&#x767E;&#x5EA6;, &#x90A3;&#x4E48;&#x4F1A;&#x53D1;&#x73B0; User-Agent &#x7684;&#x503C;&#x662F;&#x4E0D;&#x4E00;&#x6837;&#x7684;, &#x5B83;&#x4E3B;&#x8981;&#x662F;&#x7528;&#x4E8E;&#x6D4F;&#x89C8;&#x5668;&#x544A;&#x8BC9;&#x670D;&#x52A1;&#x5668;&#x81EA;&#x5DF1;&#x7684;&#x8EAB;&#x4EFD;, &#x6BD4;&#x5982;&#x6D4F;&#x89C8;&#x5668;&#x7AEF;&#x4F7F;&#x7528;&#x7684;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x662F;&#x4EC0;&#x4E48;&#x7248;&#x672C;, &#x6D4F;&#x89C8;&#x5668;&#x662F;&#x4EC0;&#x4E48;&#x7248;&#x672C;&#x7B49;&#x7B49;. &#x670D;&#x52A1;&#x5668;&#x7AEF;&#x4E3A;&#x4EC0;&#x4E48;&#x9700;&#x8981;&#x77E5;&#x9053;&#x8FD9;&#x4E2A;&#x4FE1;&#x606F;&#x5462;? &#x6211;&#x4EEC;&#x540E;&#x9762;&#x4F1A;&#x8BB2;&#x5230;&#x722C;&#x866B;&#xFF0C;&#x722C;&#x866B;&#x7A0B;&#x5E8F;&#x4E3B;&#x8981;&#x662F;&#x4ECE;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x83B7;&#x53D6;&#x6570;&#x636E;, &#x90A3;&#x4E48;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x5C31;&#x4F1A;&#x6709;&#x53CD;&#x722C;&#x673A;&#x5236;, &#x670D;&#x52A1;&#x5668;&#x4E0D;&#x5E0C;&#x671B;&#x722C;&#x866B;&#x6765;&#x83B7;&#x53D6;&#x6570;&#x636E;, &#x6240;&#x4EE5;&#x901A;&#x8FC7;&#x8BE5;&#x9879;&#x53EF;&#x4EE5;&#x77E5;&#x9053;&#x5BA2;&#x6237;&#x7AEF;&#x662F;&#x5426;&#x662F;&#x722C;&#x866B;&#x7A0B;&#x5E8F;. &#x5982;&#x679C;&#x722C;&#x866B;&#x7A0B;&#x5E8F;&#x60F3;&#x4F2A;&#x88C5;&#x6210;&#x4E00;&#x4E2A;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x8BF7;&#x6C42;, &#x5C31;&#x5FC5;&#x987B;&#x8BBE;&#x7F6E;&#x6B64;&#x9879;.</p>
</li>
<li><p>Accept &#x8868;&#x793A;&#x6D4F;&#x89C8;&#x5668;&#x544A;&#x8BC9;&#x670D;&#x52A1;&#x5668;, &#x81EA;&#x5DF1;&#x80FD;&#x591F;&#x63A5;&#x6536;&#x5E76;&#x8BC6;&#x522B;&#x7684;&#x6587;&#x4EF6;&#x7C7B;&#x578B;.</p>
</li>
<li>Accept-Encoding &#x8868;&#x793A;&#x6D4F;&#x89C8;&#x5668;&#x80FD;&#x591F;&#x5904;&#x7406;&#x7684;&#x538B;&#x7F29;&#x65B9;&#x5F0F;. &#x4E3A;&#x4EC0;&#x4E48;&#x9700;&#x8981;&#x538B;&#x7F29;&#x5462;&#xFF1F; &#x5F53;&#x7F51;&#x9875;&#x6570;&#x636E;&#x91CF;&#x5927;&#x7684;&#x65F6;&#x5019;, &#x538B;&#x7F29;&#x4E4B;&#x540E;&#x53EF;&#x4EE5;&#x63D0;&#x9AD8;&#x4F20;&#x8F93;&#x901F;&#x7387;, &#x63D0;&#x9AD8;&#x7528;&#x6237;&#x4F53;&#x9A8C;.</li>
<li>Accept-Language &#x6D4F;&#x89C8;&#x5668;&#x53EF;&#x4EE5;&#x63A5;&#x6536;&#x7684;&#x6587;&#x672C;&#x8BED;&#x8A00;, &#x5982;&#x679C;&#x975E;&#x4E2D;&#x6587;&#x7F16;&#x7801;&#x53EF;&#x80FD;&#x4F1A;&#x51FA;&#x73B0;&#x4E71;&#x7801;.</li>
</ul>
</li>
</ol>
<h3 id="&#x5C0F;&#x7ED3;">&#x5C0F;&#x7ED3;</h3>
<p><img src="imgs/&#x8BF7;&#x6C42;-2.png" alt=""></p>
<p>HTTP&#x8BF7;&#x6C42;&#x62A5;&#x6587;&#x53EF;&#x4EE5;&#x5206;&#x4E3A;GET&#x8BF7;&#x6C42;&#x548C;POST&#x8BF7;&#x6C42;&#x62A5;&#x6587;&#xFF0C;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;GET&#x8BF7;&#x6C42;&#x6CA1;&#x6709;&#x8BF7;&#x6C42;&#x4F53;&#xFF0C;POST&#x8BF7;&#x6C42;&#x6709;&#x8BF7;&#x6C42;&#x4F53;&#x4FE1;&#x606F;</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../day09/03.谷歌浏览器开发者工具查看http协议的通信过程.html" class="navigation navigation-prev " aria-label="Previous page: 开发工具查看http协议通信过程"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../day09/05.获取请求报文原数据.html" class="navigation navigation-next " aria-label="Next page: 获取请求报文原数据"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"toggle-chapters":{},"splitter":{},"emphasize":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book python高级 -->
</html>
